require 'crawler/stumbleupon_crawler'

conditions = nil
conditions = ARGV[0] unless ARGV[0].nil?

crawler = Crawler::StumbleuponCrawler.new({
  :conditions => conditions })

p crawler

log = {:stopped => true}

begin
  log = crawler.start_crawling {|c| p c}
  if log[:stopped] then
    delay = 60*60
    p "Time to sleep #{delay}sec"
    sleep delay 
  end
end while (log[:stopped])

puts "Finis"
puts log